package com.ndp.fb.rdb.api;

import com.ndp.fb.rdb.model.Pager;
import com.ndp.fb.rdb.model.rulescript.RuleScript;

import java.util.List;

/**
 * Created by sisi.chen on 15-6-25.
 */
public interface RuleScriptRdbService {
    Long save(RuleScript ruleScript);

    Pager<RuleScript> page(String userId, Integer offset, Integer limit);

    RuleScript findByUserIdAndId(String userId, Long id);

    List<RuleScript> findByUserIdAndRuleName(String userId, String ruleName);

    void updateIsRunByIdsIn(int i, List<Long> ids);

    /**
     * 获取所有可以run的脚本
     * @return
     */
    List<RuleScript> getAllRuningRule();

}
